<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="user-scalable=no,width=device-width, initial-scale=1" id="viewport" name="viewport" initial-scale="1">

<script language="javascript" type="text/javascript" src="../js/js/baseJs.js"></script>

</head>
<body style="background:#eff6ff">

<div class="wap-upload-requirements" id="uploadRequirements" style="display: none;">
    <div class="wap-header">合作申请
        <a class="back" onClick="javascript:window.history.back();return false;"></a>
    </div>
    <div class="require-c-bd"> 
      <div class="info">
        <div class="l-c">如果你有好的项目，客户比较少，那还等什么，找来赚吧平台合作，让你的项目火起来！！</div>
        <div class="l-c" style="margin-top: 0.2rem;">1.发布合作 -> 2.平台审核 -> 3.签定分成</div>
      </div>
      <div class="l-input-group">
        <div class="title-c"><div class="title" style="width: 1.3rem;">合作标题：</div><input placeholder="输入合作名称" v-model="title"></div>
        <div class="content-c"><div class="title" style="width: 1.3rem;">合作内容：</div><textarea placeholder="输入合作内容" v-model="content"></textarea></div>
      </div>
    </div>
    <div class="wap-comfirm-button" @click="saveFeedBack()">发布合作</div>
</div>
<script src="../js/js/rem_fix.js"></script>
<script src="../js/js/common.js"></script>
<script type="text/javascript">
   var token=getCookie("userToken");
   var userId=getCookie("userId");
   console.log(token)
   console.log(userId)
   var loginUrl="../userBundle/login.mobile.html"+"?"+"../userBundle/uploadRequirements.mobile.html";
   console.log(loginUrl)
   if(!token||!userId){
      window.location.href =loginUrl;
   }
  var uploadPayInfoApp = new Vue({
      el: '#uploadRequirements', 
      data: {
           title:"",
           content:"",
           isDoingSaveFeedBack:""
      },
      ready:function(){
        $("#uploadRequirements").show();
        

      },
      
      methods:{
        saveFeedBack:function(){
          if(this.isDoingSaveFeedBack ){
            return;
          }
          if(!this.title){
            alert("标题不能为空")
            return
          }
          this.isDoingSaveFeedBack=true;
          var url="/requirement/saveFeedBack ";
          var data={         
              client: 1,
              title:this.title,
              content:this.content,
              token: token,
              userId: userId
            };
            console.log(data)
            pushData(url,data,function(res){
               this.isDoingSaveFeedBack=false;
               if(res.state){
                alert("提交成功");
               }else if(res.errorCode==008){
                  window.location.href =loginUrl;
               }
               else{
                alert(res.message);
               }
            }.bind(this));
        }
      }
    })
</script>

</body>
</html>